1. Field of the Invention
The present invention relates to an improved data processing system and, in particular, to a method and apparatus within a multiprocessor data processing system. Still more particularly, the present invention provides a method and apparatus for normalizing processor clock values within a multiprocessor data processing system.
2. Description of Related Art
There are many circumstances where processor clocks within a multiprocessor data processing system should be synchronized in order to accomplish certain tasks. One example is the gathering and recordation of performance information about processes and resources within the data processing system. Timestamps may be associated with performance information as it is written to a trace buffer or to a trace file, and the timestamps assist in an analysis of the performance information. A timestamp data structure or record may comprise multiple items of information, but each timestamp may be assumed to contain a clock value that is based on one or more processor clocks within the data processing system.
In a multiprocessor information handling system, each processor may have its own independent clock, whereby each clock is driven by a different oscillator. Although the clocks are designed to run at a specific rate, each may run at a slightly different speed. In addition, external factors, such as room temperature, may affect the accuracy of the oscillators, thereby causing the clocks to drift in relation to each other. In other words, the clocks may run at different and uneven speeds.
Over a period of time, such clock drifts can become large enough to cause problems for applications that depend on consistent clock readings for all processors in the system. For example, a performance analysis application may attempt to correlate trace information from multiple processors through the use of timestamps. If the clock values in the timestamps are based on processor clocks that are significantly askew, then any correlation based on the timestamps will be inaccurate, thereby causing unpredictable analytical results.
Some prior art solutions have attempted to solve the clock drift problem at the hardware level. For example, temperature data may be fed back to an oscillator so that the oscillator can adjust its frequency to reduce or remove variations due to temperature. However, there is typically no means provided at the hardware level of an information handling system to perform for clock synchronization.
Other prior art approaches have focused on clock synchronization in distributed systems, such as a computational environment in which a set of data processing systems coordinate their operations through a network. Communication operations among computers connected by networks typically take much longer than communication operations among tightly coupled processors in a multiprocessor system. Hence, the accuracy requirement for clock synchronization in a distributed system is significantly less than the accuracy requirement for a multiprocessor system. The prior art synchronization methods used in distributed systems would be inadequate for the degree of accuracy that is required for a multiprocessor system, especially if the multiprocessor system is a tightly coupled, symmetrical, shared-memory multiprocessor system.
In contrast to prior art solutions for clock synchronization using hardware support, many software-based prior art solutions have been provided for synchronizing clocks within a multiprocessor data processing system. Given that a software-based method for synchronizing clocks inherently lacks a hardware mechanism for adjusting the operation of a processor clock or for adjusting the operating conditions of a processor clock, software-based methods are typically implemented within an operating system. However, these software-based methods may vary significantly in their principles of operation.
For example, one prior art synchronization method involves the generation of a general system clock through software support within an operating system; the general system clock is then available through a special function in the operating system to all processes that are executing in the multiprocessor data processing system. Although a general system clock may be adequate for limited purposes in the information handling system, it is not adequate for performance measurement purposes. Further, a general system clock may require a considerable amount of system resources, thereby adversely affecting the performance of the system that is being analyzed if performance measurement code continually refers to the general system clock during its operation.
Many other prior art solutions for synchronizing clocks with the support of an operating system involve the implementation of a normalization process within the operating system, whereby the operating system normalizes the clock values for each processor clock. These normalized clock values possess an accuracy that is adequate for many purposes, including performance analysis. However, some operating systems do not provide this functionality.
Consequently, although there may be a variety of hardware-based and software-based mechanisms for synchronizing multiple processor clocks within a multiprocessor data processing system, some multiprocessor data processing systems do not provide a synchronization mechanism or do not provide a mechanism that is adequate for the purposes of many applications. Therefore, it would be desirable to have a method within a multiprocessor data processing system for synchronizing processor clocks by an application that has a specific need for synchronized processor clocks. More generally, it would be advantageous to have a mechanism for implementing an application-level process for synchronizing multiple processor clocks in a multiprocessor data processing system.